#include <stdio.h>
int main()
{
  int x1, x2, y1, y2, z1, z2;
  int a[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  printf("请输入你的出生年月日(用逗号分隔):");
  scanf("%d,%d,%d", &x1, &y1, &z1);
  printf("请输入今天的年月日(用逗号分隔):");
  scanf("%d,%d,%d", &x2, &y2, &z2);
  int num = 0, i, j, k;
  //大于2年
  if ((x2 - x1) > 1)
  {
    for (i = x1 + 1; i <= x2 - 1; i++)
    {
      if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0)
        num = num + 366;
      else
        num = num + 365;
    }
  }
  //如果为闰年，则2月是29天
  if (x1 % 4 == 0 && x1 % 100 != 0 || x1 % 400 == 0)
    a[2] = 29;
  //如果是同一年
  if (x1 == x2)
  {
    for (i = y1 + 1; i < y2; i++)
    {
      num = num + a[i];
    }
    num = num + (a[y1] - z1) + z2;
  }
  a[2] = 28;
  //如果x2-x1==1时
  if (x1 != x2)
  {
    if (x1 % 4 == 0 && x1 % 100 != 0 || x1 % 400 == 0)
      a[2] = 29;
    for (i = y1 + 1; i <= 12; i++)
    {
      num += a[i];
    }
    num += (a[y1] - z1);
    a[2] = 28;
    if (x2 % 4 == 0 && x1 % 100 != 0 || x2 % 400 == 0)
      a[2] = 29;
    for (i = y2 - 1; i >= 1; i--)
    {
      num += a[i];
    }
    num += z2;
  }
  printf("你已经活了 %d 天了。", num);
  return 0;
}